﻿using System;
using System.Collections.Generic;
using System.Text;

namespace AdaptiveAgents.Tools
{
    class AverageGradeRecord : Record
    {

        private double m_dAverageGrade;
        private double m_iIndex;
        private double m_dCalculateAverage;

        private double m_dProbability0;
        private double m_dProbability1;
        private double m_dProbability2;

        public AverageGradeRecord(double eps0, double eps1, double eps2, double comp0, double comp1, double comp2, double turns0, double turns1, double turns2, double average,double index): base(eps0,eps1,eps2,comp0,comp1,comp2,turns0,turns1,turns2)
        {
            m_dAverageGrade = average;
            m_iIndex = index;        
        }

        public AverageGradeRecord(Record rec):base(rec){}

        public AverageGradeRecord(Record rec, double average, double index) : base(rec)
        {
            m_dAverageGrade = average;
            m_iIndex = index;
        }

        public void setAverage(double avrg)
        {
            m_dAverageGrade = avrg;
        }

        public double getAverage()
        {
            return m_dAverageGrade;
        }

        public void setCalculateAverage(double avrg)
        {
            m_dCalculateAverage = avrg;
        }

        public double getCalculateAverage()
        {
            return m_dCalculateAverage;
        }

        public void setIndex(double index)
        {
            m_iIndex = index;
        }

        public double getIndex()
        {
            return m_iIndex;
        }

        public Record getRecord()
        {
            Record returnRec = new Record(base.getEpsilon(0), base.getEpsilon(1), base.getEpsilon(2), base.getCompetence(0), base.getCompetence(1), base.getCompetence(2), base.getNumOfTurnsPlayed(0), base.getNumOfTurnsPlayed(1), base.getNumOfTurnsPlayed(2));
            return returnRec;
        }

        public void setProbabilities(double probability,int index)
        {
            if (index == 0)
            {
                m_dProbability0 = probability;
            }
            else if (index == 1)
            {
                m_dProbability1 = probability;
            }
            else if (index == 2)
            {
                m_dProbability2 = probability;
            }
        }

        public double getProbabilities(int index)
        {
            if (index == 0)
            {
                return m_dProbability0;
            }
            else if (index == 1)
            {
                return m_dProbability1;
            }
            else
            {
                return m_dProbability2;
            }
        }
    
    
    }
}
